import useRequest from "@/api/useRequest";
export class resourceController {

  static getRemoteResourceInfo(data:any): Promise<any>{
    return useRequest({
      url: "/remoteResource/getRemoteResource",
      method: "post",
      data
    })
  }



  static addSDResource(data:any): Promise<any> {
    return useRequest({
      url: "/remoteResource/addSDResource",
      method: "post",
      data
    })
  }

  static deleteResource(resourceId:string): Promise<any> {
    return useRequest({
      url: "/remoteResource/deleteSDResource?id="+resourceId,
      method: "get"
    })
  }

  static updateResource(data:any): Promise<any> {
    return useRequest({
      url: "/remoteResource/updateSDResource",
      method: "post",
      data
    })
  }

  static deleteBatch(data:any): Promise<any> {
    return useRequest({
      url: "/remoteResource/addSDResource",
      method: "post",
      data
    })
  }


  static getSDResource(type:string): Promise<any> {
    return useRequest({
      url: "/remoteResource/getSDResource?type="+type,
      method: "get"
    })
  }


  static getLLMInfo(): Promise<any> {
    return useRequest({
      url: "/remoteResource/getLlmInfo",
      method: "get"
    })
  }

    static saveLlmInfo(data:any): Promise<any> {
        return useRequest({
          url: "/remoteResource/saveLlmInfo",
          method: "post",
          data
        })
    }

    static getTranslateInfo(): Promise<any> {
        return useRequest({
          url: "/remoteResource/getTranslateInfo",
          method: "get"
        })
    }

  static getAzureTTS(): Promise<any> {
    return useRequest({
      url: "/remoteResource/getAzureTTS",
      method: "get"
    })
  }

  static saveAzureTTS(data:any): Promise<any> {
    return useRequest({
      url: "/remoteResource/saveAzureTTS",
      method: "post",
      data
    })
  }

    static saveTranslateInfo(data:any): Promise<any> {
        return useRequest({
          url: "/remoteResource/saveTranslateInfo",
          method: "post",
          data
        })
    }

  static async getReousceConfig(resouceId:string): Promise<any> {
    return useRequest({
      url: "/stableDiffusionServer/getRemoteStableDiffusionInfo?resourceId="+resouceId,
      method: "get"
    })
  }

  static changeOption(data:any): Promise<any> {
    return useRequest({
      url: "/stableDiffusionServer/changeOption",
      method: "post",
      data
    })
  }


  static getOptions(resourceId:string): Promise<any> {
    return useRequest({
      url: "/stableDiffusionServer/getOptions?resourceId="+resourceId,
      method: "get"
    })
  }

  static resourceTest(resourceId:string): Promise<any> {
    return useRequest({
      url: "/remoteResource/remoteResourceTest?resourceId="+resourceId,
      method: "get"
    })
  }

  static remoteResourceTestNoRegister(data:any): Promise<any> {
    return useRequest({
      url: "/remoteResource/remoteResourceTestNoRegister",
      method: "post",
      data
    })
  }


  static refreshCache():Promise<any>{
    return useRequest({
      url: "/remoteResource/refreshCache",
      method: "get"
    })
  }


}
